package org.yaaic.utils;

import org.yaaic.irc.IRCService;
import org.yaaic.model.Conversation;
import org.yaaic.model.Message;
import org.yaaic.model.Server;

public class msgutils
{
    public void sendMsg(String Msg, Server server, Conversation conversation, IRCService service){
        service.getConnection(server.getId()).sendMessage(conversation.getName(), Msg);
    }
    public void joinChannel(String channel, Server server, IRCService service){
        service.getConnection(server.getId()).joinChannel(channel);
    }
    public void joinChannel(String channel, String key, Server server, IRCService service){
        service.getConnection(server.getId()).joinChannel(channel, key);
    }
    public Message getLastMsg(Conversation conversation){
        return conversation.getHistoryMessage(0);
    }
}
